items = []
while (True):
  key = input('请输入key: ')
  if key == '::exit': break
  value = input('请输入value: ')
  keyValue = [key, value]
  items.append(keyValue)
d = dict(items)
print(d)


dictA = {
  'name': 'Alex',
  'age': 18,
  'weight': '55kg'
}

def getValueByKey(key, targetDict):
  if key in targetDict:
    return targetDict[key]
  else:
    return ('key不存在')

res = getValueByKey('name', dictA)
print(res)

res2 = getValueByKey('age', dictA)
print(res2)